home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n20.arc / MK4_UD1.XTS < prev    next >
Text File  |  1990-10-29  |  4KB  |  85 lines

  1. /*
  2.     MK4_UD1.XTS
  3.         PC MagNet Utilities Database
  4.         command line driven down load script
  5.         by Rick Ayre, 6.8.90
  6. */
  7.  
  8. if null(arg) then chain "ud2"        --if no file is entered on the
  9.                                      --command line you must have meant
  10.                      --to run MK4_UD2.XTS, so I do
  11. n = 1                                
  12. i = 0                                -- declare variables and set values
  13. string my_file, choice, dFile[30]    -- where needed
  14.  
  15. while not null(arg(n))          -- loop to parse command line arguments
  16.    i = i + 1                    -- increment file array counter
  17.    dFile[i] = arg(n)            -- assign argument name to file array name
  18.    if exists (dFile[i]) then {  -- check to see if file exists already
  19.         cls                     -- if so leave a note and
  20.         print "This file already exists:",dFile[i]
  21.         print "Get others? (Y/N)"      -- ask to continue
  22.         input choice
  23.         i = i - 1                --dump file by decrementing array counter
  24.         if choice = "n" then end --if user answers NO, end script
  25.    }
  26.    n = n + 1                     --increment argument number counter
  27. wend
  28.  
  29. label call_magnet                -- routine to dial and log on
  30.    if null(arg) or i = 0 then end  -- unless there are no files to down load
  31.  
  32.    load "CSERVE"                 -- Either name your dialing entry CSERVE or
  33.    protocol "CSERVEB"            -- enter yours in it's place
  34.    call "CSERVE"
  35.    wait 20 ticks,
  36.    reply
  37.    wait for "Host Name:",
  38.    reply "CIS"
  39.    wait for "User ID:",
  40.    reply "#####,###"             -- Your UserID goes in place of "#"s
  41.    wait for "Password:",
  42.    display off                   -- Make sure display is OFF Password is not echoed
  43.    reply "*****.*******"         -- Your Password goes in place of "*"s
  44.    wait 5 seconds for space chr(13),
  45.    display on                    -- Turn display back on
  46.  
  47. repeat                           -- Loop to load file names from
  48.    my_file = dFile[i]            -- array into string for down load
  49.    gosub get_file                -- Jump to routine that down loads file
  50.    i = i - 1                     -- Decrement file array counter
  51. until i = 0                      -- Loop ends when there are no files in array
  52.  
  53. wait quiet 5 ticks : reply "OFF"    -- Quit MagNet
  54. wait for "Host Name:" : BYE : end   -- Hang up phone line and end script
  55.  
  56. label get_file                   -- Routine to down load files
  57.    wait quiet 5 seconds,
  58.    reply "go pcm:utilit"
  59.    wait for "!",
  60.    reply "4"
  61.    wait for "e (example, DR.COM):",
  62.    reply my_file
  63.    watch for                            -- This watch for traps errors that occur
  64.       "ad this file? (Y/N)" : reply "y" -- when the file name had been spelled
  65.        "!" : goto no_file               -- wrong or was ambiguous
  66.    endwatch
  67.    wait for "> to begin transfer!",
  68.    wait quiet 5 ticks,
  69.    Reply
  70.    wait for "!",
  71.    reply "5"
  72. /* --If you are running Mk.4 v1.X you must uncomment the "if filter" line
  73.    if filter = 'CONTROL' then fmap = fmap | 65568
  74. */ --To uncomment the above line simple delete the "/*" and the "*/"
  75.    wait quiet 5 seconds,
  76.    return                        -- Return to repeat loop
  77.  
  78. label no_file                    -- Routine to inquire how to proceed
  79.    print "File not found!"       -- when the file was not found
  80.    print "Continue with others? (Y/N)"
  81.    input choice
  82.    if choice = "n" then end
  83.    shut                          -- Close window
  84.    return                        -- Retrun to repeat loop
  85.